package com.xiaoyao.myframeapp.JavaCode.welcome;

import android.graphics.Color;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import android.widget.ImageView;

import com.trello.rxlifecycle2.components.support.RxAppCompatActivity;

public class AppIntroActivity extends RxAppCompatActivity {
    //public class AppIntroActivity extends AppIntro {
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

//        SliderPage sliderPage1 = new SliderPage();
//        sliderPage1.setTitle("Welcome!");
//        sliderPage1.setDescription("This is a demo of the AppIntro library.");
//        sliderPage1.setImageDrawable(R.drawable.ic_slide1);
//        sliderPage1.setBgColor(Color.TRANSPARENT);
//        addSlide(AppIntroFragment.newInstance(sliderPage1));
//
//        SliderPage sliderPage2 = new SliderPage();
//        sliderPage2.setTitle("Clean App Intros");
//        sliderPage2.setDescription("This library offers developers the ability to add clean app intros at the start of their apps.");
//        sliderPage2.setImageDrawable(R.drawable.ic_slide2);
//        sliderPage2.setBgColor(Color.TRANSPARENT);
//        addSlide(AppIntroFragment.newInstance(sliderPage2));
//
//        SliderPage sliderPage3 = new SliderPage();
//        sliderPage3.setTitle("Simple, yet Customizable");
//        sliderPage3.setDescription("The library offers a lot of customization, while keeping it simple for those that like simple.");
//        sliderPage3.setImageDrawable(R.drawable.ic_slide3);
//        sliderPage3.setBgColor(Color.TRANSPARENT);
//        addSlide(AppIntroFragment.newInstance(sliderPage3));
//
//        SliderPage sliderPage4 = new SliderPage();
//        sliderPage4.setTitle("Explore");
//        sliderPage4.setDescription("Feel free to explore the rest of the library demo!");
//        sliderPage4.setImageDrawable(R.drawable.ic_slide4);
//        sliderPage4.setBgColor(Color.TRANSPARENT);
//        addSlide(AppIntroFragment.newInstance(sliderPage4));
//
//        showSeparator(false);

        // Declare a new image view
        ImageView imageView = new ImageView(this);

        // Bind a drawable to the imageview
//        imageView.setImageResource(R.drawable.ic_sample_bg);

        // Set background color
        imageView.setBackgroundColor(Color.BLACK);

        // Set layout params
        imageView.setLayoutParams(new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));


//        RequestOptions options = new RequestOptions()
////                .placeholder(R.mipmap.ic_launcher)    //加载成功之前占位图
////                .error(R.mipmap.ic_launcher)    //加载错误之后的错误图
////                .override(400, 400)    //指定图片的尺寸
//                //指定图片的缩放类型为fitCenter （等比例缩放图片，宽或者是高等于ImageView的宽或者是高。）
////                .fitCenter()
//                //指定图片的缩放类型为centerCrop （等比例缩放图片，直到图片的狂高都大于等于ImageView的宽度，然后截取中间的显示。）
//                .centerCrop()
////                .circleCrop()//指定图片的缩放类型为centerCrop （圆形）
////                .skipMemoryCache(true)    //跳过内存缓存
////                .diskCacheStrategy(DiskCacheStrategy.ALL)    //缓存所有版本的图像
////                .diskCacheStrategy(DiskCacheStrategy.NONE)    //跳过磁盘缓存
////                .diskCacheStrategy(DiskCacheStrategy.DATA)    //只缓存原来分辨率的图片
////                .diskCacheStrategy(DiskCacheStrategy.RESOURCE)//只缓存最终的图片
//                ;

//        Glide.with( this)
//                .load(R.drawable.ic_sample_bg)
//                .into(imageView);

        // Bind the background to the intro
//        setBackgroundView(imageView);

    }

//    @Override
//    public void onSkipPressed(Fragment currentFragment) {
//        super.onSkipPressed(currentFragment);
//        finish();
//    }
//
//    @Override
//    public void onDonePressed(Fragment currentFragment) {
//        super.onDonePressed(currentFragment);
//        finish();
//    }

}
